<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>HTTP Hacker</title>
<link href="/static/css/simple.css" rel="stylesheet" type="text/css"
	media="all" />

<script type="text/javascript" src="/static/js/jquery-1.6.2.js"></script>
<script type="text/javascript" src="/static/js/jquery.hotkeys.js"></script>

<script type="text/javascript" src="/static/js/custom.js"></script>

<script type="text/javascript">
	$(function() {
		var container = $('#container');
		var headerHtml = container.html();

		var add = $('#add');
		if (add) {
			add.live('click', function() {
				container.append(headerHtml);
			});
		}
		;

		var get = $('#get');
		if (get) {
			get.live('click',
					function() {
						var header = [];
						var header_names = $('select.header_name');
						var header_values = $('input.header_value');
						for ( var i = 0; i < header_names.length; i++) {
							var headername = header_names[i];
							var headervalue = header_values[i];
							if (notEmpty(headername.value)) {
								header.push(headername.value + ":"
										+ headervalue.value);
							}
						}

						var f_get = $("form#f_get");
						f_get.find("#header").val(header);
						f_get.submit();
					});
		}
		;

		var ifrm = $('#ifrm');

		if (ifrm) {
			ifrm.live('mouseover', function() {
				//alert(ifrm.html());
			});
		}
		;

		window.frames['ifrm'].document.body.onclick = function() {
			alert("diandian");
		};

	});
</script>


</head>

<body bgcolor="#E0E0E0">

	<div style="margin: 2px 2px 2px 2px;">
		<strong class="b1"></strong><strong class="b2 d1"></strong> <strong
			class="b3 d1"></strong><strong class="b4 d1"></strong>

		<div class="b d1" style="">
			<form id="f_get" name="f_get" action="/http/get" target="ifrm"
				method="post">
				Target host: <input id="url" name="url" type="text" size="142" /><br />
				<div id="container">
					Header name: <select class="header_name">
						<c:forEach items="${httpHeadersList}" var="httpheader">
							<option id="${httpheader}">${httpheader}</option>
						</c:forEach>
					</select>
					<!--  -->
					Header value: <input type="text" class="header_value" size="100" />
					<!--  -->
					<br />
				</div>

				<input type="hidden" id="header" name="header" value="Test:OK" />
				<!--  -->
				<input type="button" id="add" value="Add" style="width: 785px;" />
				<br />
				<!--  -->
				<span><input type="button" id="get" value="Get" /></span>
			</form>
		</div>


		<strong class="b4b d1"></strong><strong class="b3b d1"></strong> <strong
			class="b2b d1"></strong><strong class="b1b"></strong>
	</div>

	<iframe id="ifrm" src="http://www.baidu.com" width="100%" height="70%"></iframe>

	<%@ include file="/jsp/inc/footer.jsp"%>
</body>
</html>